/*
 * @Description: 
 * @Author: fhw
 * @Date: 2022-11-18 11:13:34
 */
import { ApiProperty } from '@nestjs/swagger'
import { IsNotEmpty, IsDefined, IsNumber } from 'class-validator'

export class SendChatDto {
  @IsNotEmpty({ message: '用户id不能为空' })
  @IsDefined({ message: '用户id不是为undefined或null' })
  @IsNumber()
  @ApiProperty({
    type: Number,
    name: 'userId',
    description: '用户id',
  })
  public readonly userId: number

  @IsNotEmpty({ message: '用户名称不能为空' })
  @IsDefined({ message: '用户名称不是为undefined或null' })
  @ApiProperty({
    type: String,
    name: 'username',
    description: '用户名称',
  })
  public readonly username: string

  @IsNotEmpty({ message: '接收人id不能为空' })
  @IsDefined({ message: '接收人id不是为undefined或null' })
  @IsNumber()
  @ApiProperty({
    type: Number,
    name: 'to_userId',
    description: '接收人id',
  })
  public readonly to_userId: number

  @IsNotEmpty({ message: '接收人名称不能为空' })
  @IsDefined({ message: '接收人名称不是为undefined或null' })
  @ApiProperty({
    type: String,
    name: 'to_username',
    description: '接收人名称',
  })
  public readonly to_username: string

  @IsNotEmpty({ message: '消息内容不能为空' })
  @IsDefined({ message: '消息内容不是为undefined或null' })
  @ApiProperty({
    type: String,
    name: 'content',
    description: '消息内容',
  })
  public readonly content: string

  @IsNotEmpty({ message: '文本类型不能为空' })
  @IsDefined({ message: '文本类型不是为undefined或null' })
  @IsNumber()
  @ApiProperty({
    type: Number,
    name: 'type',
    description: '文本类型,1:文字',
  })
  public readonly type: number
}
export class SetIsReadDto {
  @ApiProperty({
    type: Number,
    name: 'userId',
    description: '用户id',
  })
  public readonly userId: number
  @ApiProperty({
    type: Number,
    name: 'userId',
    description: '用户id',
  })
  public readonly to_userId: number
}
